//
//  ViewController.m
//  relevanceKVO
//
//  Created by ZhangSai on 2021/8/20.
//

#import "ViewController.h"
#import "Person.h"

@interface ViewController ()

@property (nonatomic, strong) Person *person;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.person = [[Person alloc] init];
    
//    self.person.writtenData = 10;
    
    [self.person setValue:@(20)forKey:@"writtenData"];
    
}

/// 4. 手动修改值
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    // 修改 writtenData、totalData 来改变downloadProgress
//    self.person.writtenData += 10;
    self.person.totalData  += 1;
}

@end
